package twelfth.合并流;

import java.io.*;

public class 合并两个文件 {
    public static void main(String[] args) throws IOException {
        InputStream is1= new FileInputStream(new File("D:\\WorkSpaces\\JavaDevelopBase_start_329\\src\\twelfth\\demo2.txt"));
        InputStream is2= new FileInputStream(new File("D:\\WorkSpaces\\JavaDevelopBase_start_329\\src\\twelfth\\demo3.txt"));
        FileOutputStream fos  = new FileOutputStream(new File("D:\\WorkSpaces\\JavaDevelopBase_start_329\\src\\twelfth\\SequenceInputStream.txt"));
        SequenceInputStream sis = new SequenceInputStream(is1,is2);
        int temp = 0;
        while ((temp=sis.read())!=-1){
            fos.write(temp);
        }
        sis.close();
        is1.close();
        is2.close();
        fos.close();
    }
}
/*
八九十之花
亭台六七座hello,王境泽！
 */